<% @custom ||= Relation::Custom.new(actor_id: subject.actor_id) %>

<%= form_for @custom, :remote => true do |f| %>
  <%= f.hidden_field :actor_id %>

  <% if @custom.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@custom.errors.count, "error") %> prohibited this custom relation from being saved:</h2>

      <ul>
      <% @custom.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <%= f.text_field :name %>

  <%= f.submit nil, :class => "btn" %>
<% end %>

<%= javascript_tag do %>
  $("#cancel_new_relation_custom").click(function() {   
    $("#new_relation_custom_input_block").hide();
    $("#new_relation_custom_title_block").show();
    return false;
  });
<% end %>
